CXXFLAGS=-I/usr/include -I../src/cpp/generated -I../src/cpp -Igenerated -I. -fPIC
LDFLAGS=-L/usr/lib

all: libSpammerFactoryServer.so

libSpammerFactoryServer.so: ../src/cpp/generated/PropertyType.o ../src/cpp/generated/PropertyService.o ../src/cpp/generated/ASDF.o ../src/cpp/generated/FIPATypes.o ../src/cpp/generated/FIPA.o generated/Spammer.o SpammerFactoryServer.o SpammerFactoryI.o ../src/cpp/AgentI.o SpammerI.o
	gcc -fPIC -shared -o $@ -Wl,-soname,libAgentFactoryServer.so.33 $^ -lIce -lIceUtil -lIceStorm -lIceGrid
	/sbin/ldconfig -v -n .

../src/cpp/generated/%.h ../src/cpp/generated/%.cpp: ../slice/%.ice
	slice2cpp --output-dir ../src/cpp/generated -I/usr/share/slice -I../slice $<

generated/%.h generated/%.cpp: %.ice
	slice2cpp --output-dir generated -I/usr/share/slice -I../slice -I. $<

clean:
	rm -rf generated/*
	rm -rf *.o *.pyc lib* *~	